<template>
  <h1>双向绑定指令</h1>
  <input type="text" :value="info"><br>
  {{info}}<br>
  姓名:<input type="text" name="uname" v-model="user.uname"><br>
  密码:<input type="text" name="password" v-model="user.password"><br>
  性别:
  <input type="radio" value="1" name="gender" v-model="user.gender">
  <input type="radio" value="0" name="gender" v-model="user.gender"><br>
  <button @click="reg()">提交</button>
</template>

<script setup>
  import {ref} from "vue";

  const info=ref('666');
  const  user=ref(
      {
        uname:'张三',
        password:'1234',
        gender:'1'
      }
  )
  const reg=()=>{
    console.log(user.value);
  }

</script>

<style scoped>

</style>